const {StatusEnum} = require("../enum/status.enum");
module.exports = (err,ctx)=>{
    console.error('server error', err, ctx)
    let status = ''
    switch (err.code){
        case '10001':
            status = StatusEnum.userErrorStatus
            break
        case '10002':
            status = StatusEnum.userErrorStatus
            break
        default:
            status = StatusEnum.errorStatus
    }
    ctx.status = status
    ctx.body = err
}
